﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProductSystem.BLL.Common
{
    public class PromptMessage
    {
        private static object locker = new object();
        private static PromptMessage instance;

        public static PromptMessage Instance()
        {
            if (null == instance)
            {
                lock (locker)
                {
                    if (null == instance)
                    {
                        instance = new PromptMessage();
                    }
                }
            }
            return instance;
        }

        /// <summary>
        /// 获取提示信息
        /// </summary>
        /// <param name="status">状态</param>
        /// <param name="message">提示内容</param>
        /// <returns></returns>
        public ReturnStatus GetPrompt(bool status, string message)
        {
            ReturnStatus rs = new ReturnStatus();
            rs.Status = status;
            if (status)
                rs.ErrorCode = 1;
            else
                rs.ErrorCode = 0;
            rs.Message = message;
            return rs;
        }
    }
}
